package com.ruoyi.web.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.web.domain.ReservationFail;
import com.ruoyi.web.mapper.ReservationFailMapper;
import com.ruoyi.web.service.IReservationFailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;

/**
 * 预约失败Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-02
 */
@Service
public class ReservationFailServiceImpl implements IReservationFailService
{
    @Autowired
    private ReservationFailMapper reservationFailMapper;

    /**
     * 查询预约失败
     * 
     * @param id 预约失败主键
     * @return 预约失败
     */
    @Override
    public ReservationFail selectReservationFailById(Long id)
    {
        return reservationFailMapper.selectReservationFailById(id);
    }

    /**
     * 查询预约失败列表
     * 
     * @param reservationFail 预约失败
     * @return 预约失败
     */
    @Override
    public List<ReservationFail> selectReservationFailList(ReservationFail reservationFail)
    {
        return reservationFailMapper.selectReservationFailList(reservationFail);
    }

    /**
     * 新增预约失败
     * 
     * @param reservationFail 预约失败
     * @return 结果
     */
    @Override
    public int insertReservationFail(ReservationFail reservationFail)
    {
        reservationFail.setCreateTime(DateUtils.getNowDate());
        return reservationFailMapper.insertReservationFail(reservationFail);
    }

    /**
     * 修改预约失败
     * 
     * @param reservationFail 预约失败
     * @return 结果
     */
    @Override
    public int updateReservationFail(ReservationFail reservationFail)
    {
        reservationFail.setUpdateTime(DateUtils.getNowDate());
        return reservationFailMapper.updateReservationFail(reservationFail);
    }

    /**
     * 批量删除预约失败
     * 
     * @param ids 需要删除的预约失败主键
     * @return 结果
     */
    @Override
    public int deleteReservationFailByIds(String ids)
    {
        return reservationFailMapper.deleteReservationFailByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除预约失败信息
     * 
     * @param id 预约失败主键
     * @return 结果
     */
    @Override
    public int deleteReservationFailById(Long id)
    {
        return reservationFailMapper.deleteReservationFailById(id);
    }
}
